import { checkEnv } from '@/lib/utils';
import dotenv from 'dotenv';
import { defineConfig } from 'drizzle-kit';

dotenv.config({
  path: '.env.production',
});

export default defineConfig({
  out: './drizzle',
  schema: './src/lib/db/schema',
  dialect: 'postgresql',
  dbCredentials: {
    user: checkEnv('POSTGRES_USER'),
    password: checkEnv('POSTGRES_PASSWORD'),
    host: checkEnv('SERVER_IP'),
    port: +checkEnv('POSTGRES_PORT', '5432'),
    database: checkEnv('POSTGRES_DB'),
    ssl: false,
  },
});
